<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="https://unpkg.com/vue@next"></script>
    <div id="app">
        <todo-item :num="curLevel">Hello World</todo-item>
    </div>

    <script>
        const vueOpt = {
            data(){
                return {
                    curLevel: 3
                }
            }
        }

        const app = Vue.createApp(vueOpt);

        app.component('todo-item', {
            data(){
                return {
                    
                }
            },
            props: {
                num: {
                    type: Number,
                    required: true
                }
            },
            template: `
                <h1 v-if="num === 1">
                    <slot></slot>
                </h1>

                <h2 v-else-if="num === 2">
                    <slot></slot>
                </h2>

                <h3 v-else-if="num === 3">
                    <slot></slot>
                </h3>
            `
        })
        app.mount('#app')

    </script>
</body>
</html>